﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin_City.Aspx.cs" Inherits="Master_Admin_City" %>
<%@ Register src="UserControl/Admin_foot.ascx" tagname="Admin_foot" tagprefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>城市管理</title>
        <link href="Css/Css.css" rel="stylesheet" type="text/css" /> 
 
</head>
<body >
<form runat="server">
<br />
     <table width="98%" height="0" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
    <tr align="center" bgcolor="#efefef"> 
      <td width="28%" height="25">省份添加</td>
      <td width="37%">
          <asp:TextBox ID="Txt_Prov" runat="server"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
              ControlToValidate="Txt_Prov" Display="Dynamic" ErrorMessage="省份名称不能为空"></asp:RequiredFieldValidator>
        </td>
      <td width="35%">
          <asp:Button ID="Button1" runat="server" Text="添加" onclick="Button1_Click" /></td>
    </tr>
</table> 
<br />


<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
    CellPadding="3" ForeColor="Black" GridLines="Vertical" Width="98%" 
    DataKeyNames="id" HorizontalAlign="Center" 
    onrowediting="GridView1_RowEditing" 
    onrowcancelingedit="GridView1_RowCancelingEdit" 
    onrowupdating="GridView1_RowUpdating" 
    onrowdeleting="GridView1_RowDeleting" onrowcommand="GridView1_RowCommand" 
    onrowdatabound="GridView1_RowDataBound" >
    <Columns>
        <asp:TemplateField HeaderText="省份">
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <ItemTemplate>
                <%#Eval("ClassName") %>
            </ItemTemplate>
            <EditItemTemplate>
                
                <asp:TextBox ID="NewClassName" runat="server" Text='<%#Eval("ClassName") %>' ></asp:TextBox>
               
            </EditItemTemplate>
           
        </asp:TemplateField>
        <asp:TemplateField HeaderText="操作">
            <EditItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                    CommandName="Update" Text="更新"></asp:LinkButton>&nbsp;&nbsp;&nbsp;
                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                    CommandName="Cancel" Text="取消"></asp:LinkButton>&nbsp;&nbsp;&nbsp;
            </EditItemTemplate>
            <ItemTemplate>
            <a href="Admin_CityShow.Aspx?pid=<%#Eval("id") %>">查看城市</a>&nbsp;&nbsp;&nbsp;
                      <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" 
                    CommandName="Orders" CommandArgument='<%#Eval("id") %>' Text="排&nbsp;&nbsp;序"></asp:LinkButton>&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                    CommandName="Edit" Text="编&nbsp;&nbsp;辑"></asp:LinkButton>&nbsp;&nbsp;&nbsp;
                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                    CommandName="Delete" Text="删&nbsp;&nbsp;除" OnClientClick="javascript:return confirm('是否真的删除省份信息,这样将会同时删除所属城市!')" ></asp:LinkButton>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#CCCCCC" />
    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
    <AlternatingRowStyle BackColor="#CCCCCC" />
    <EditRowStyle CssClass="EditStyle" />



</asp:GridView> 

</form>     <uc1:Admin_foot ID="Admin_foot1" runat="server" />

</body>
</html>
